package com.epoque.admin.server.rpc;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.epoque.admin.server.model.GateLog;
import com.epoque.admin.server.service.GateLogService;
import com.epoque.security.api.vo.log.LogInfo;

/**
 * 
 * @ClassName: LogService
 * @Description: 日志服务类
 * @author qiuxianfeng
 * @date 2018年8月29日
 *
 */
@RequestMapping("api")
@Controller
public class LogControllerService {
	
    @Autowired
    private GateLogService gateLogService;
    
    /**
     * 
     * @Title: saveLog
     * @author qiuxianfeng
     * @Description: 保存日志
     * @param @param info    参数
     * @return void    返回类型
     * @throws
     */
    @RequestMapping(value="/log/save",method = RequestMethod.POST)
    public @ResponseBody void saveLog(@RequestBody LogInfo info){
        GateLog log = new GateLog();
        BeanUtils.copyProperties(info,log);
        gateLogService.insertSelective(log);
    }
}
